11#if !defined(__SPIR32__) && !defined(__SPIR64__)
12#error "This header file should be used with SPIR target only."
17#pragma OPENCL EXTENSION cl_khr_fp64 : enable
21#define const_func __attribute__((const))
22#define readonly __attribute__((pure))
52#if defined(__SPIR32__)
54#elif defined (__SPIR64__)
64#if defined(__SPIR32__)
66#elif defined (__SPIR64__ )
67typedef long ptrdiff_t;
137#define MAXFLOAT 0x1.fffffep127f
144#define HUGE_VALF (__builtin_huge_valf())
151#define HUGE_VAL (__builtin_huge_val())
157#define INFINITY (__builtin_inff())
162#define NAN as_float(__builtin_nanf((char const *)""))
164#define FP_ILOGB0 INT_MIN
165#define FP_ILOGBNAN INT_MAX
168#define FLT_MANT_DIG 24
169#define FLT_MAX_10_EXP +38
170#define FLT_MAX_EXP +128
171#define FLT_MIN_10_EXP -37
172#define FLT_MIN_EXP -125
174#define FLT_MAX 0x1.fffffep127f
175#define FLT_MIN 0x1.0p-126f
176#define FLT_EPSILON 0x1.0p-23f
179#define DBL_MANT_DIG 53
180#define DBL_MAX_10_EXP +308
181#define DBL_MAX_EXP +1024
182#define DBL_MIN_10_EXP -307
183#define DBL_MIN_EXP -1021
185#define DBL_MAX 0x1.fffffffffffffp1023
186#define DBL_MIN 0x1.0p-1022
187#define DBL_EPSILON 0x1.0p-52
190#define M_E_F 2.71828182845904523536028747135266250f
191#define M_LOG2E_F 1.44269504088896340735992468100189214f
192#define M_LOG10E_F 0.434294481903251827651128918916605082f
193#define M_LN2_F 0.693147180559945309417232121458176568f
194#define M_LN10_F 2.30258509299404568401799145468436421f
195#define M_PI_F 3.14159265358979323846264338327950288f
196#define M_PI_2_F 1.57079632679489661923132169163975144f
197#define M_PI_4_F 0.785398163397448309615660845819875721f
198#define M_1_PI_F 0.318309886183790671537767526745028724f
199#define M_2_PI_F 0.636619772367581343075535053490057448f
200#define M_2_SQRTPI_F 1.12837916709551257389615890312154517f
201#define M_SQRT2_F 1.41421356237309504880168872420969808f
202#define M_SQRT1_2_F 0.707106781186547524400844362104849039f
204#define M_E 0x1.5bf0a8b145769p+1
205#define M_LOG2E 0x1.71547652b82fep+0
206#define M_LOG10E 0x1.bcb7b1526e50ep-2
207#define M_LN2 0x1.62e42fefa39efp-1
208#define M_LN10 0x1.26bb1bbb55516p+1
209#define M_PI 0x1.921fb54442d18p+1
210#define M_PI_2 0x1.921fb54442d18p+0
211#define M_PI_4 0x1.921fb54442d18p-1
212#define M_1_PI 0x1.45f306dc9c883p-2
213#define M_2_PI 0x1.45f306dc9c883p-1
214#define M_2_SQRTPI 0x1.20dd750429b6dp+0
215#define M_SQRT2 0x1.6a09e667f3bcdp+0
216#define M_SQRT1_2 0x1.6a09e667f3bcdp-1
220#define SCHAR_MIN (-128)
222#define CHAR_MAX SCHAR_MAX
223#define CHAR_MIN SCHAR_MIN
224#define USHRT_MAX 65535
225#define SHRT_MAX 32767
226#define SHRT_MIN (-32768)
227#define UINT_MAX 0xffffffff
228#define INT_MAX 2147483647
229#define INT_MIN (-2147483647-1)
230#define ULONG_MAX 0xffffffffffffffffUL
231#define LONG_MAX ((long)0x7fffffffffffffffL)
232#define LONG_MIN ((long)(-0x7fffffffffffffffL-1))
235#define DBL_MANT_DIG 53
236#define DBL_MAX_10_EXP +308
237#define DBL_MAX_EXP +1024
238#define DBL_MIN_10_EXP -307
239#define DBL_MIN_EXP -1021
240#define DBL_MAX 0x1.fffffffffffffp1023
241#define DBL_MIN 0x1.0p-1022
242#define DBL_EPSILON 0x1.0p-52
5825#define CLK_LOCAL_MEM_FENCE 0x1
5831#define CLK_GLOBAL_MEM_FENCE 0x2
6483#define __kernel_exec(X, typen) __kernel \
6484 __attribute__((work_group_size_hint(X, 1, 1))) \
6485 __attribute__((vec_type_hint(typen)))
6487#define kernel_exec(X, typen) __kernel \
6488 __attribute__((work_group_size_hint(X, 1, 1))) \
6489 __attribute__((vec_type_hint(typen)))
7009#define CLK_ADDRESS_NONE 0
7010#define CLK_ADDRESS_CLAMP_TO_EDGE 2
7011#define CLK_ADDRESS_CLAMP 4
7012#define CLK_ADDRESS_REPEAT 6
7013#define CLK_ADDRESS_MIRRORED_REPEAT 8
7018#define CLK_NORMALIZED_COORDS_FALSE 0
7019#define CLK_NORMALIZED_COORDS_TRUE 1
7024#define CLK_FILTER_NEAREST 0x10
7025#define CLK_FILTER_LINEAR 0x20
7256void __attribute__((overloadable)) write_imagef (__write_only image2d_array_t image, int4
coord, float4
color);
7258void __attribute__((overloadable)) write_imageui (__write_only image2d_array_t image, int4
coord, uint4
color);
7262void __attribute__((overloadable)) write_imagef (__write_only image1d_buffer_t image,
int coord, float4
color);
7264void __attribute__((overloadable)) write_imageui (__write_only image1d_buffer_t image,
int coord, uint4
color);
7265void __attribute__((overloadable)) write_imagef (__write_only image1d_array_t image, int2
coord, float4
color);
7267void __attribute__((overloadable)) write_imageui (__write_only image1d_array_t image, int2
coord, uint4
color);
7357#define CLK_RG 0x10B2
7358#define CLK_RA 0x10B3
7359#define CLK_RGB 0x10B4
7360#define CLK_RGBA 0x10B5
7361#define CLK_BGRA 0x10B6
7362#define CLK_ARGB 0x10B7
7363#define CLK_INTENSITY 0x10B8
7364#define CLK_LUMINANCE 0x10B9
7365#define CLK_Rx 0x10BA
7366#define CLK_RGx 0x10BB
7367#define CLK_RGBx 0x10BC
7368#define CLK_DEPTH 0x10BD
7369#define CLK_DEPTH_STENCIL 0x10BE
7374#define CLK_SNORM_INT8 0x10D0
7375#define CLK_SNORM_INT16 0x10D1
7376#define CLK_UNORM_INT8 0x10D2
7377#define CLK_UNORM_INT16 0x10D3
7378#define CLK_UNORM_SHORT_565 0x10D4
7379#define CLK_UNORM_SHORT_555 0x10D5
7380#define CLK_UNORM_INT_101010 0x10D6
7381#define CLK_SIGNED_INT8 0x10D7
7382#define CLK_SIGNED_INT16 0x10D8
7383#define CLK_SIGNED_INT32 0x10D9
7384#define CLK_UNSIGNED_INT8 0x10DA
7385#define CLK_UNSIGNED_INT16 0x10DB
7386#define CLK_UNSIGNED_INT32 0x10DC
7387#define CLK_HALF_FLOAT 0x10DD
7388#define CLK_FLOAT 0x10DE
7389#define CLK_UNORM_INT24 0x10DF
7480void __attribute__((overloadable)) write_imagef(__write_only image2d_array_t image_array, int4
coord, float4
color);
7485void __attribute__((overloadable)) write_imagei(__write_only image2d_array_t image_array, int4
coord, int4
color);
7490void __attribute__((overloadable)) write_imageui(__write_only image2d_array_t image_array, int4
coord, uint4
color);
7497#define as_char(x) __builtin_astype((x), char)
7498#define as_char2(x) __builtin_astype((x), char2)
7499#define as_char3(x) __builtin_astype((x), char3)
7500#define as_char4(x) __builtin_astype((x), char4)
7501#define as_char8(x) __builtin_astype((x), char8)
7502#define as_char16(x) __builtin_astype((x), char16)
7504#define as_uchar(x) __builtin_astype((x), uchar)
7505#define as_uchar2(x) __builtin_astype((x), uchar2)
7506#define as_uchar3(x) __builtin_astype((x), uchar3)
7507#define as_uchar4(x) __builtin_astype((x), uchar4)
7508#define as_uchar8(x) __builtin_astype((x), uchar8)
7509#define as_uchar16(x) __builtin_astype((x), uchar16)
7511#define as_short(x) __builtin_astype((x), short)
7512#define as_short2(x) __builtin_astype((x), short2)
7513#define as_short3(x) __builtin_astype((x), short3)
7514#define as_short4(x) __builtin_astype((x), short4)
7515#define as_short8(x) __builtin_astype((x), short8)
7516#define as_short16(x) __builtin_astype((x), short16)
7518#define as_ushort(x) __builtin_astype((x), ushort)
7519#define as_ushort2(x) __builtin_astype((x), ushort2)
7520#define as_ushort3(x) __builtin_astype((x), ushort3)
7521#define as_ushort4(x) __builtin_astype((x), ushort4)
7522#define as_ushort8(x) __builtin_astype((x), ushort8)
7523#define as_ushort16(x) __builtin_astype((x), ushort16)
7525#define as_int(x) __builtin_astype((x), int)
7526#define as_int2(x) __builtin_astype((x), int2)
7527#define as_int3(x) __builtin_astype((x), int3)
7528#define as_int4(x) __builtin_astype((x), int4)
7529#define as_int8(x) __builtin_astype((x), int8)
7530#define as_int16(x) __builtin_astype((x), int16)
7532#define as_uint(x) __builtin_astype((x), uint)
7533#define as_uint2(x) __builtin_astype((x), uint2)
7534#define as_uint3(x) __builtin_astype((x), uint3)
7535#define as_uint4(x) __builtin_astype((x), uint4)
7536#define as_uint8(x) __builtin_astype((x), uint8)
7537#define as_uint16(x) __builtin_astype((x), uint16)
7539#define as_long(x) __builtin_astype((x), long)
7540#define as_long2(x) __builtin_astype((x), long2)
7541#define as_long3(x) __builtin_astype((x), long3)
7542#define as_long4(x) __builtin_astype((x), long4)
7543#define as_long8(x) __builtin_astype((x), long8)
7544#define as_long16(x) __builtin_astype((x), long16)
7546#define as_ulong(x) __builtin_astype((x), ulong)
7547#define as_ulong2(x) __builtin_astype((x), ulong2)
7548#define as_ulong3(x) __builtin_astype((x), ulong3)
7549#define as_ulong4(x) __builtin_astype((x), ulong4)
7550#define as_ulong8(x) __builtin_astype((x), ulong8)
7551#define as_ulong16(x) __builtin_astype((x), ulong16)
7553#define as_half(x) __builtin_astype((x), half)
7554#define as_half2(x) __builtin_astype((x), half2)
7555#define as_half3(x) __builtin_astype((x), half3)
7556#define as_half4(x) __builtin_astype((x), half4)
7557#define as_half8(x) __builtin_astype((x), half8)
7558#define as_half16(x) __builtin_astype((x), half16)
7560#define as_float(x) __builtin_astype((x), float)
7561#define as_float2(x) __builtin_astype((x), float2)
7562#define as_float3(x) __builtin_astype((x), float3)
7563#define as_float4(x) __builtin_astype((x), float4)
7564#define as_float8(x) __builtin_astype((x), float8)
7565#define as_float16(x) __builtin_astype((x), float16)
7567#define as_double(x) __builtin_astype((x), double)
7568#define as_double2(x) __builtin_astype((x), double2)
7569#define as_double3(x) __builtin_astype((x), double3)
7570#define as_double4(x) __builtin_astype((x), double4)
7571#define as_double8(x) __builtin_astype((x), double8)
7572#define as_double16(x) __builtin_astype((x), double16)
auto dot(const vec< T, size > &x, const vec< T, size > &y)
T min(const T &x, const T &y, const T &z)
auto length(const vec< T, size > &x)
int size auto cross(const vec< T, size > &x, const vec< T, size > &y)
int size auto fmax(const vec< T, size > &x, const vec< T, size > &y)
auto normalize(const vec< T, size > &x)
auto max(const vec< T, size > &x, const vec< T, size > &y)
int size auto fmin(const vec< T, size > &x, const vec< T, size > &y)
char const_func char minval
int printf(__constant const char *st,...)
float __global float * cosval
event_t const __global char size_t size_t src_stride
event_t const __global char size_t event_t event
char2 const __global char * p
event_t const __global char size_t num_elements
float4 const_func float4 p1
char const_func char char maxval
float const_func float float c
void event_t * event_list
float const_func float edge1
float4 sampler_t int2 coord
char2 const_func uchar2 mask
uint cl_mem_fence_flags
All work-items in a work-group executing the kernel on a processor must execute this function before ...
#define const_func
Added according to pocl/examples/example1-spir64/generate_spir.sh.
unsigned char uchar
An unsigned 8-bit integer.
event_t const __global char * src
unsigned long ulong
An unsigned 64-bit integer.
unsigned int uint
An unsigned 32-bit integer.
float __global float * iptr
float __global int * signp
unsigned short ushort
An unsigned 16-bit integer.
ptrdiff_t intptr_t
The unsigned integer type of the result of the sizeof operator.
float float __global int * quo
event_t const __local char size_t size_t dst_stride
char char2 __attribute__((ext_vector_type(2)))
Returns the number of global work-items specified for dimension identified by dimindx.
short const_func uchar lo
float const_func float float a
#define __global
Added according to pocl/examples/example1-spir64/generate_spir.sh.